<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Class template basic_pipe</title>
<link rel="stylesheet" href="../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
<link rel="home" href="../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset">
<link rel="up" href="../process.html#doxygen.pipe_8hpp" title="Header &lt;boost/process/v1/pipe.hpp&gt;">
<link rel="prev" href="classboost_1_1process_1_1v1_1_1basic__opstream.html" title="Class template basic_opstream">
<link rel="next" href="structboost_1_1process_1_1v1_1_1basic__pipebuf.html" title="Struct template basic_pipebuf">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../boost.png"></td>
<td align="center"><a href="../../../index.html">Home</a></td>
<td align="center"><a href="../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1process_1_1v1_1_1basic__opstream.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../process.html#doxygen.pipe_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1process_1_1v1_1_1basic__pipebuf.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
<div class="refentry">
<a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe"></a><div class="titlepage"></div>
<div class="refnamediv">
<h2><span class="refentrytitle">Class template basic_pipe</span></h2>
<p>boost::process::v1::basic_pipe</p>
</div>
<h2 class="refsynopsisdiv-title">Synopsis</h2>
<div class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: &lt;<a class="link" href="../process.html#doxygen.pipe_8hpp" title="Header &lt;boost/process/v1/pipe.hpp&gt;">boost/process/v1/pipe.hpp</a>&gt;

</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> CharT<span class="special">,</span> <span class="keyword">typename</span> Traits <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">char_traits</span><span class="special">&lt;</span><span class="identifier">CharT</span><span class="special">&gt;</span> <span class="special">&gt;</span> 
<span class="keyword">class</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">{</span>
<span class="keyword">public</span><span class="special">:</span>
  <span class="comment">// types</span>
  <span class="keyword">typedef</span> <span class="identifier">CharT</span>            <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a95de5d5879d80f71a8ac0a4b11933c7f"></a><span class="identifier">char_type</span><span class="special">;</span>    
  <span class="keyword">typedef</span> <span class="identifier">Traits</span>           <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a245e514f9083a5ad615533297f62b4c0"></a><span class="identifier">traits_type</span><span class="special">;</span>  
  <span class="keyword">typedef</span> <span class="identifier">Traits</span><span class="special">::</span><span class="identifier">int_type</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a9649f2a8727caa8b05006a9ef074ef28"></a><span class="identifier">int_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">Traits</span><span class="special">::</span><span class="identifier">pos_type</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1af8491f1c7132fb73895922a879083f0c"></a><span class="identifier">pos_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="identifier">Traits</span><span class="special">::</span><span class="identifier">off_type</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a1e0915bb82d24e32e0d77c9956e68cbe"></a><span class="identifier">off_type</span><span class="special">;</span>     
  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span>      <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1af4e4a6d724766061eaeb740fd03eff8e"></a><span class="identifier">native_handle</span><span class="special">;</span>

  <span class="comment">// <a class="link" href="boost_container_header_reference/classboost_1_1container_1_1devector.html#id18-bb">public member functions</a></span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1aeaa0287f9e4c2dfd4d7948fc4cfc4b8b"><span class="identifier">basic_pipe</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">explicit</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a8e2e92f52016d33ea15aebf2c8e5fd53"><span class="identifier">basic_pipe</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1ae5b8afd77b0ac5bcb68927a02619504b"><span class="identifier">basic_pipe</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a1d7406e659333d9949cdf8c11d22de5c"><span class="identifier">basic_pipe</span></a><span class="special">(</span><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1acbf88bdaa7855449e9ed3467f2be1c83"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a38853acfd1436374833c86b27ad823ac"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;&amp;</span><span class="special">)</span><span class="special">;</span>
  <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a18ab002d31f5b195cacfab3f7a46286e"><span class="special">~</span><span class="identifier">basic_pipe</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">native_handle</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1ae267c7802980520d12113ca39bab482d"><span class="identifier">native_source</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="identifier">native_handle</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a757eeec9f873ca1e372fb94d8ea12c08"><span class="identifier">native_sink</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1adf33dd534fb444c021c04f1ffa779598"><span class="identifier">assign_source</span></a><span class="special">(</span><span class="identifier">native_handle</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a77a822fc6f77c12087396be3cbc689b7"><span class="identifier">assign_sink</span></a><span class="special">(</span><span class="identifier">native_handle</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">int_type</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a4fd9c2241bb2aa9af4d0e2fbf41d525f"><span class="identifier">write</span></a><span class="special">(</span><span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">int_type</span><span class="special">)</span><span class="special">;</span>
  <span class="identifier">int_type</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a6fdb5d4200020157009b3ab067de4c2a"><span class="identifier">read</span></a><span class="special">(</span><span class="identifier">char_type</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">int_type</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">bool</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a9d2f8ba6a324087b4f5a12c1e82ac1c8"><span class="identifier">is_open</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
  <span class="keyword">void</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html#doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a6ccd7f77c8454dc3240ee7f022922b23"><span class="identifier">close</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span>
<span class="special">}</span><span class="special">;</span></pre></div>
<div class="refsect1">
<a name="id-1.3.30.4.8.19.5.4"></a><h2>Description</h2>
<p>Class implementation of a pipe. </p>
<div class="refsect2">
<a name="id-1.3.30.4.8.19.5.4.3"></a><h3>
<a name="id18-bb"></a><code class="computeroutput">basic_pipe</code> public member functions</h3>
<div class="orderedlist"><ol class="orderedlist" type="1">
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1aeaa0287f9e4c2dfd4d7948fc4cfc4b8b"></a><span class="identifier">basic_pipe</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Default construct the pipe. Will be opened. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">explicit</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a8e2e92f52016d33ea15aebf2c8e5fd53"></a><span class="identifier">basic_pipe</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="special">&amp;</span> name<span class="special">)</span><span class="special">;</span></pre>Construct a named pipe. </li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1ae5b8afd77b0ac5bcb68927a02619504b"></a><span class="identifier">basic_pipe</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
<p>Copy construct the pipe. </p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Duplicated the handles. </p></td></tr>
</table></div>
<p>
</p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a1d7406e659333d9949cdf8c11d22de5c"></a><span class="identifier">basic_pipe</span><span class="special">(</span><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;&amp;</span> lhs<span class="special">)</span><span class="special">;</span></pre>
<p>Move construct the pipe. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1acbf88bdaa7855449e9ed3467f2be1c83"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> p<span class="special">)</span><span class="special">;</span></pre>
<p>Copy assign the pipe. </p>
<div class="note"><table border="0" summary="Note">
<tr>
<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../doc/src/images/note.png"></td>
<th align="left">Note</th>
</tr>
<tr><td align="left" valign="top"><p>Duplicated the handles. </p></td></tr>
</table></div>
<p>
</p>
</li>
<li class="listitem">
<pre class="literallayout"><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a38853acfd1436374833c86b27ad823ac"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><a class="link" href="classboost_1_1process_1_1v1_1_1basic__pipe.html" title="Class template basic_pipe">basic_pipe</a> <span class="special">&amp;&amp;</span> lhs<span class="special">)</span><span class="special">;</span></pre>
<p>Move assign the pipe. </p>
</li>
<li class="listitem">
<pre class="literallayout"><a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a18ab002d31f5b195cacfab3f7a46286e"></a><span class="special">~</span><span class="identifier">basic_pipe</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>
<p>Destructor closes the handles. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">native_handle</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1ae267c7802980520d12113ca39bab482d"></a><span class="identifier">native_source</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the native handle of the source. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">native_handle</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a757eeec9f873ca1e372fb94d8ea12c08"></a><span class="identifier">native_sink</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
<p>Get the native handle of the sink. </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1adf33dd534fb444c021c04f1ffa779598"></a><span class="identifier">assign_source</span><span class="special">(</span><span class="identifier">native_handle</span> h<span class="special">)</span><span class="special">;</span></pre>
<p>Assign a new value to the source </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a77a822fc6f77c12087396be3cbc689b7"></a><span class="identifier">assign_sink</span><span class="special">(</span><span class="identifier">native_handle</span> h<span class="special">)</span><span class="special">;</span></pre>
<p>Assign a new value to the sink </p>
</li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">int_type</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a4fd9c2241bb2aa9af4d0e2fbf41d525f"></a><span class="identifier">write</span><span class="special">(</span><span class="keyword">const</span> <span class="identifier">char_type</span> <span class="special">*</span> data<span class="special">,</span> <span class="identifier">int_type</span> count<span class="special">)</span><span class="special">;</span></pre>Write data to the pipe. </li>
<li class="listitem">
<pre class="literallayout"><span class="identifier">int_type</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a6fdb5d4200020157009b3ab067de4c2a"></a><span class="identifier">read</span><span class="special">(</span><span class="identifier">char_type</span> <span class="special">*</span> data<span class="special">,</span> <span class="identifier">int_type</span> count<span class="special">)</span><span class="special">;</span></pre>Read data from the pipe. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">bool</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a9d2f8ba6a324087b4f5a12c1e82ac1c8"></a><span class="identifier">is_open</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Check if the pipe is open. </li>
<li class="listitem">
<pre class="literallayout"><span class="keyword">void</span> <a name="doxygen.classboost_1_1process_1_1v1_1_1basic__pipe_1a6ccd7f77c8454dc3240ee7f022922b23"></a><span class="identifier">close</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre>Close the pipe. </li>
</ol></div>
</div>
</div>
</div>
<div class="copyright-footer">Copyright © 2006-2012 Julio M. Merino Vidal, Ilya Sokolov,
      Felipe Tanus, Jeff Flinn, Boris Schaeling<br>Copyright © 2016 Klemens D. Morgenstern<p>
        Distributed under the Boost Software License, Version 1.0. (See accompanying
        file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
      </p>
</div>
<hr>
<div class="spirit-nav">
<a accesskey="p" href="classboost_1_1process_1_1v1_1_1basic__opstream.html"><img src="../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../process.html#doxygen.pipe_8hpp"><img src="../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="structboost_1_1process_1_1v1_1_1basic__pipebuf.html"><img src="../../../doc/src/images/next.png" alt="Next"></a>
</div>
</body>
</html>
